Adding initial type checking. Now we need to perform an exhaustive
testing. First, write down a list of all tricky cases and test them.