Fix derivative

The main changes are:
	- The bug in the computation of lambda functions has been fixed.
 	- Testderivative works properly.
 	- The bug in the computation of lambda functions has been fixed.