Replaced deprecated code.