Corrected debugging functions