Minor tidy-up around type and annotations.