Replace some deprecated methods.