Some fixes for the build.
reverting did some weird stuff. Think I captured it all with this commit.