Replace FREE with FREE_ARRAY in most cases