Various cleanup. This should've been like 3 commits but oh well.