Make mode_for_vector return an opt_mode