Fixed bug in selectValue functions