fixed C type mismatch in closure generation