Various build-related fixes.