Fixed deprecated code.