Some build system fixes