Fixes debug notices when checking for debug mode