Fixed loop limit errors in Matrix.h

In few of the overloaded operators the loop limits (i.e. M and N) were swapped.