Fixed a bunch more stuff, hopefully nothing is broken, but the whole
thing gets farther now at least.