Comparing objects that might be arrays