game: prevent possible segfault, clean up