Made debugging messages conditional