Made debug output statements configurable.