fix deprecation warnings in 2-1-stable

cherry-picked from 2-2-stable