Removed some un-needed code in build scripts, and corrected errors