Minor code tidy-ups