Fix derivative regenerating.