Various fixes/tidying