Properly close input streams.
Fix wrong item in spawn menu (fixes #75).