Rebuild library and fix build script.