Merge #18249 with fixes

Merge #18249 with fixes