Added asObject() function to objects instead of arrays