Improvements for fix#10057.