Fix problem with recursive functions with a type signature