Fixes for issue #17187 and enhance test case test_Switch-setter.html.