Bug fix in Matrix