Fix issue #9800, #9814, #9792