Adds safer handling of collection return values