Added some matrix utilities.