Solve QMat linking issues.