fixes to collection handling in schema factory