fix clang warnings, update build script