Fix build script to fail properly