Backport 283a2ed from master to 4-1-stable

@tenderlove asked me to backport @schneems to 4-1-stable, so this will make it into the next release.