Fixed a bug and added some error handling.

Fixed a typo (global instead of globals) and added some error handling
when reading the JSON config file.

Also converted tabs to spaces, causing all lines to show up as changed.