Add Trace feature, and some fix