Form validation fixes and enhancement