remove unused vars.
Respect trace argument for pending.
This will be useful for the pretty formatter.