Misc fixes and build stuff