Fix assignment/comparison bug in gstd_get_mech