Fix tracing for patterns