Fix buggy end of game