Avoid recursive value change events.

This should take care of the stack overflow issue found by Firov.
Avoid a division by zero.

When there is only one choice in the list, there is no point in calculating
what the slider value should be: just set it to 1.