Fixed an end-game bug.