Fix calls to deprecated methods