Fixed x64 compiler complaints by clarifying casts