Local error control in codes for ordinary differential equations