Surround mode-changing code with #if debug