Add explicit type casting

to prevent Visual C++ 6.0 compiler warnings