Fixed issue with negative weight.
Removed unnecessary reverse().
Merge pull request #369 from Sanchiz/7.x-1.x