API: bug fix in matrix