Fix integer overflow problem
Merge remote-tracking branch 'github/master'