Made debugging output optional.