Fixing matrix determinant