Fix bug in diffFn