Fixed negative weight bug.