Upgrade use of deprecated function.