Fix crash in Context::main_sel_register_value