Added dump_trace() for debugging