Various fixes to generators