Some build-related fixes from the last merge