A few more code tidy-ups