Updated debug functionality