Fix minor issues with casting from int to long

Fix minor issues with casting from int to long