Fixed debug-mode checks