Compiler warnings

Fixes several compiler warnings (hopefully without breaking the build this time :D)