Fixed bug in trace slicing