(cherry picked from commit 54c914d48fefa730728518d50fc9e49032d0947b) (cherry picked from commit 1bf87bf8735f7e7eb1b2d207d3015a7301b558bf) Closes #2638 Closes #2569