Replace calls to deprecated functions with non-deprecated alternatives where available.