Fix 6945

Fixes #6945.