fixed potential number overflow
Merge pull request #1 from elexx/master

fixed potential number overflow