Fixed bug in setValue() where we were setting the value to the index, rather than the correct underlying value