Bug fixes, build script