Fix errors in build script