Slightly more robust build script