Notice it's done "if $debug".  I actually backported this from the devel branch.