Bug fixes, tidy-up etc.