port 5b55401ce from the master branch.

This ports the same fixes we have in chosen's master to the harvest branch, just incase someone updates the vendor drop.

for @pfiller.