Fix for array types with documents