Misc cleanup and tidying