Fix bug in smooth_traces