Fix all remaining errors in 1.7.x

The codebase crashes quite quickly, though, so it needs a lot of work still.