Fix: Assert checking the wrong value

Fixed assert to refer to correct in-loop value.