Nearly preserving numerical methods for differential equations