fix build breaks and update build script