fixing some issues with reporting a game over, adding tests