Improve type annotations.