A bunch of fixes for various compiler warnings