Bugfix: the size of valarray of the resized matrix was not calculated
correctly