Refactor 'set matrix zeroes'.