Fixed iteration and min_qty bug