Lots of miscellaneous changes

I really, really need to commit more.