lean(lp): fixing a bug in apply_reverse_from_left, adding more asserts