Fixes game_ending segfaults.