Updated build script and fixed tests.