Working to make csh_flow_mod work sanely and tidy debug code