Fix several compile warnings