Code cleanups mostly related to form validation.