Clean up some comments
Add missing brackets for weights calculation
Merge remote-tracking branch 'upstream/master'
Merging with rrma fixes.