Fixed bug for determinant