Fixed end of game handling
Made end of game crash less by handling bad input