fix build-from-scratch errors