Re #2389. Added parameter to pass workspace index to fitting function.