Side effect in grow_weights
The grow_weights method modifies the input mask argument as a side effect. And the calling code depends on this. This should probably be changed so that the function returns a new mask and the calling code uses that.
Edited by Jesper Baasch-Larsen