Port 12154

Port of #12154 to master