Possible bug fix for issue #125. Unit test added.
Minor performance optimization. We shouldn't need to update the visibility unless the rangeOptions changed.
Minor bug fix. Copying fix from commit e2ee3a348d3a8b0efb973c37c3a9c95404ad769a into another location.