Fix bug in recursive function typing

Some functions were considered as infinite recursion, while they
obviously were not.