Remove internal use of deprecated methods.

Recently deprecated methods are causing lots of warnings.  This PR fixes that.