Fixed bug in complex derivative