Fixed compiler warnings around implicit conversions losing floating-point precision

This commit fixes compiler warnings around implicit conversions losing floating-point precision