fixes to HMat