fix a integer overflow error
Merge branch 'master' into 1.0