     to_remove = $(@).closest 'fieldset'
     recompute_positions parent
 
-    parent.trigger 'has_many_remove:before', [ to_remove ]
+    parent.trigger 'has_many_remove:before', [to_remove]
     to_remove.remove()
 
   # Provides before and after creation hooks:

  position   = 0

  parent.children('fieldset').each ->
    fieldset = $(@)
    # when looking for inputs, we ignore inputs from the possibly nested inputs
    # so, when defining your has_many, make sure to keep the sortable input at the root of the has_many block
    destroy_input  = fieldset.find "> ol > .input > :input[name$='[_destroy]']"
    sortable_input = fieldset.find "> ol > .input > :input[name$='[#{input_name}]']"

    if sortable_input.length
      sortable_input.val if destroy_input.is ':checked' then '' else position++

  $(document).on 'has_many_add:after', '.has_many_container', init_sortable


init_sortable = ->
  elems = $('.has_many_container[data-sortable]:not(.ui-sortable)')
  elems.sortable \
