Fix type conversion compiler warnings

This changes address type conversion compilation warnings when such warnings are enabled in the compiler.