Fixed a bug in build script