Ported more matrix utils