Balanced the tensor fit and matrix fit in the objective function
Merge branch 'balancefit' into develop