Bugfix matrix normalization