Fixed a logical error in the build script