Add validation and correct deviations from the specification