fixed: global_opts now is never None