Fix quality flaws: remove usage of deprecated API.