Small fixes to build system