fdo#78976: Test for this.

Change-Id: I454e29c2cdf0857d329d84000d79973489cebb41
fdo#78976: Correct way to determine the end position for matrix check.

Change-Id: Ifd6acd85a9bf33742cb62327a3b8a4320f35d0f3