Fix lots of compiler warnings