Added control_debug keyword flag and control output.