Avoid deprecated API
Fix assorted clang warnings