Debug mode fix