Tidying up, minor tweaks and fixes