Fixes #1002 : Some issue with typecast int

Fixes #1002