Backport 58b9e7e and 3a946ff to 6.7

Confidently letting Travis have at this while waiting for #440 to get tested and merged.