Fix a potential class cast exception.
Add new unit tests for multi-select boxes.