Fix type hints.
Use contract.