Add some additional type hints.
Remove some preconditions.