fix type cast
Merge pull request #1098 from achamely/master

Fix type cast