fix a few problems with my matrix commit

Change-Id: I6e3fdf4bd26c952a59ad130dc6e5c9d1f3ff5f07