Updated debug functions