build script bug fixes