More modifications, fixes and tidying up