Fixed some form validation bugs