Fixed bugs when pausing game between states.