Fixed bug in derivative.
Merge pull request #44 from luca-heltai/fix-derivative-iterated

Fixed bug in derivative.