Fix: Phase wrap was not reset
Fixed another reset bug
Fixed dereference bug