Fix a few compile warnings and deprecations