Revert "Fix type conversion warnings."

This reverts commit ff4f76444c947fcf8d87ba81a968f2bfc04e93da.
Fix conversion warnings using static_cast.