Fixes a bug in displaying the correct selected values.