Fixed bugs with collections.