Jeremy Newman : fix depreciated functions