Modifying the build file to work with the bundles
Fixed some bugs with the build script