Addition of trace wiping on return of null, and further tests on trace in the presence of exceptions