Also distinguish between objects and arrays correctly