Added explicit casts to make it 64-bit compatible (without any warnings)

What it says in the title.