Fixed issue with function returning array of objects.