Fix select2 directive to be compatible with form validation.