Tweaked form validation, fixed a bug