Match tracing separated

And bugs fixed