Fix item instanceof Array, replacing with Array.isArray(item) check