Adds open/close and a guard to loc and qf
More guarding