This fixes a regression introduced by c5544d28. Thanks John Eskew for the reporti and Tim Graham for the review. Backport of ada7a4ae from master.