Changed the way tracing of guards is finished

When a guard is being traced and an opening guard is found, the resulting trace is terminated but now no longer forms a loop