         $template.val template.id
       .select2 'enable', true
     else
-      $provisionerRole.select2 'val', null
+      $provisionerRole.val([])
       $provisionerRole.select2 'enable', false
 
   # Initialise the templates dropdown

    .select2 'enable', enable

  # Populate the "Select a distro" dropdown
  $distro.select2
    placeholder: 'Select a distro'
    data:
      results:  _.sortBy $distroSelect, 'distro'
    formatSelection: distroFormat
    formatResult: distroFormat

  # Once a distro has been chosen, populate the template dropdown with that distro's available
  # templates.
  .on 'change', (e) ->
    data = e.added
    distro = data.id
    populateTemplateSelect(distro)
    # Ensure there is no template selected yet
    $templateId.val(-1)

  populateDistros = ->
    $distro.select2
      placeholder: 'Select a distro'

    $(this).tab('show')
    $(this).parent('li').addClass('active')

    $provisionerRole.val([])
    $distro.val([])
    $template.val([])

  $costs            = $('span.total-cost')
  $boxes            = $('ul.package-boxes').find('> li')
