Hmm, this looks like a typo in my behalf. I'll have a look at it again soon, I may have had a good reason at the time that I have forgotten now.

Yes I am assuming weights sum to 1 - could easily just normalise weights to force this constraint?