Build script fixes