Fixed issues with form validation