Protect against null currPenRef in resetStateVars