Added game-over check; minor changes.