Fixed a few issues in the build scripts.