Make validity check return errors and handle them