Fix #21558 and #14950