Fix when call_user_func is invoked inside an internal function