Better typing in typecheck.sol