Fix lots of compile warnings