Fixed bugs in how collections of items are handled.