Fixed a bug that caused the game to crash.