Fix bit-shifting problem

Shifting an int value 32 or more bits will not give the expected result.
Need to cast to long before shifting.
Merge pull request #33 from johlo/FindBugs

Fix bit-shifting problem