Fix wrong behaviour when submitting form.