Fixed typing derivation for recursion