Fixing compiler warnings about deprecated APIs.