         values = JSON.parse @hidden.value()
         valueToPosition = {}
 
-        _.each values, (v, i) -> valueToPosition[v] = i
+        for v, i in values
+          valueToPosition[v] = i
 
         e = @available.element
 

      doMoveDown: ->
        options = _.toArray @selected.element.options

        movers = _.filter options, isSelected

        # The element after the last selected element is the pivot; all the selected elements will
        # move after the pivot. If there is no pivot, the elements are shifted to the end of the list.
        lastMoverIndex = _.last(movers).index
        pivot = options[lastMoverIndex + 1]

        options = _.reject options, isSelected

        splicePos = if pivot then _.indexOf(options, pivot) + 1 else options.length



        @valueToOrderIndex = {}

        for option,i in @available.element.options
          @valueToOrderIndex[option.value] = i

        # This occurs even when the palette is disabled, to present the
