Fix bug with end of game