Misc changes.

Don’t mind the massive-ness of this commit. It’s all miscellaneous.