Replaced deprecated code with current.