Fixes #6351 and #6350.
Fixes #6297