Cleaning up build script and changing the working dir.