Fixed some logic errors in the game.