matrix fixes