Implementation of r_set_select()

Targets #176
Nothing. Just found this bug. Will extract tomorrow and submit in a separate PR.