small bug fixes to do with collections