Quick tidy up. A few bug fixes before file release.