Some tidying and minor fixes/enhancements