Fixes rangematrix