Handles fatal errors better

Moved saving of Tiles.json into a `finally`
Log any exceptions