Matrix bugfixes.