fixes to array to object and object to array