Correct computation of matrix determinant
Remove exception in contribution function