Fix answeronpolarityswitch and hanguponpolarityswitch when both are yes (#6229)