Fixed int overflow
Merge pull request #22 from oscarpicas/master

Fixed int overflow