Fix small bugs in new build system