Bug fixes/bit of tidying