Changed check of determinant