Fix bug where collections of primitives would result in an exception

Presumably this is a bug -- I think this is the right fix...