A few bugfixes in the build system
Merge branch 'pure'