MSVC 64 bit warnings fixed

Compiling with MSVC 9.0 I had to fix some warnings. Please review.