Fix getSelectedItems function if option is object.