Fixed determinant code.