Fix return value bug in build script