Fixed bug with saving derivations.