Fixing unsigned integer type for matrices