Fixed bug in affine space for derivativees higher than 1.