setres: Use named modes, instead of a temporary mode hack

This should be more reliable altogether, and avoids unecessary
mode switches.