Fixed build script issues