Improve form validation and submit behaviour.