Fixes a bug when restarting game.