Fix for #6649.
Fix for #7330.