Fix for some issues in directional derivatives