Fixes and tidying