Adding unit tests for the Trace API; fixed some minor bugs found while

doing so.