Change matrix accessors from int to unsigned int
Explicit unsigned int to int cast where needed