Fixed handling of selected values