JSON-related bugfixes

When given broken files, try to stop the game normally.
Try to recover from bad names file.