Fixed typecast warnings when compiling for 64-bit