fixing #239

introducing special handling for arrays of objects