Fix the generation of foreign modules (which are not a functor)