Fix issue #10027, #10024, #10026, #10021