Fix two warnings from gcc and clang

gcc complained about the cast to int and clang complained about both.
Merge pull request #41 from dubhater/warnings

Fix two warnings from gcc and clang