Add tests for TracePoint and improve code accordingly.