Minor improvements to game loop