Fixed bug when generating matrix (impossible to get inverse).