More fixes to collection generation