Improved form validation for measurements.