Issue #2166915 by ianthomas_uk, sun | plach: Remove uses of deprecated language functions in tests and procedural code.