Tidying and deprecation fixes.