Fixed bug in deriv1d