Added check for debugging being enabled before attempting to send debug info.