Remove some compiler warnings

I mostly added some type casts to stop compiler warnings. It doesn't change much, but having less noise when compiling the project is always good. :)