BUG: mantis #1373: quick return for diagonal matrices