Game Crashes When Changing Scenes When Built

So, just for fun, I wanted to see how my game worked as an EXE. So I added a couple of out-of-Unity-relevant scripts to the thing and clicked “Build and Run.” Everything worked fine up to the point where the game was supposed to switch to a new scene. At first, the game crashed, but after I fiddled with it slightly, now it just permanently freezes. Here are the scene-switching code snippets:

When you die, you hit space to restart Scene 0:

#pragma strict

public var restartLevel : String;

function Update(){
	if(Input.GetKeyDown(KeyCode.Space)){
		Application.LoadLevel(restartLevel);
	}
}

When you hit the goal cube, you go to the next scene, as defined by the variable nextLevel:

#pragma strict

public var nextLevel : String;

function OnCollisionEnter(myCollision : Collision){
	if(myCollision.gameObject.name == "NextLevelCube"){
		Application.LoadLevel(nextLevel);
	}
}

Both instances have been tried, and both have failed every time.

Maybe I’m using the wrong commands? Both scripts work like a dream in Unity itself, but whenever I build and run, they just fail miserably.

Any help would be welcome.

same problem