Fixes and tidyup