Casting clean-ups to fix compiler warnings.

Source:
and