Trace clean-up and tests.