Fixed a bug that was causing the avgMat matrix of weightings to be of the wrong size