Tidying and doc fixes