AJAX error on form alter
You're not supposed to change the $form element in the AJAX callback, only in the form_alter function. Otherwise,


  when the form is submitted (ajax or not), the submitted form does not
  match the cached form, which causes Drupal to fail