Fixed attach_pfunc.