Revert "Fix undefined totalWeight value crash"

This reverts commit 1edfbc14fc480ab79d9343eeefc2d0acced76b8e.