Fixed a bug where dying at the very end of a level could crash the game.