Added some more compiler warning flags, and then added a bunch of explicit type conversions to get rid of the warnings.