Fix calls to deprecated method