This fixes #7113 and fixes #7114.