Replace some deprecated method calls