Fixes for non-square matrices and local dof indexing.