Trace Generate bug fix