Check for debug mode properly