Fixed a few issues with the build scripts