Fix crashing bugs

**This isn't ready to be merged.**

Obviously these need to be done properly and have tests written, and @lennym may have caught some of them in his massive refactor.

This pull request is just a reminder that if you run the application somewhere without a network connection, it will crash a bit.