Refactored parse collection when JSON XPath is used to handle arrays in a uniform way.