Fixed bug of incorrect score recording when manually exiting the game state.