Fixes and tidying up here and there