More fixes and improvements to the new build system.