Fixed a bug that would sometimes prevent the player from exiting a level.