(PUP-3341) fix follow-up ENC issue in apply

Rebased on stable, replaces #3119.