Update deprecated methods
(cherry picked from commit aa4b1b7)