Another try at fixing compile warnings on 4.0