matrix class: bug fixed and template parameter types changed.

- recursive template instantiation for types with M < 1 and N < 1 prevented
- template parameter types (for M and N) changed from uint8_t to unsigned int