Same fix in make.generate, but implemented using existing API. Hack removed from last commit.