Fixed a bunch of warnings related to implicit casts