Fix compiler warnings about the deprecated API