Revert "Revert "Merge pull request #2588 from christianv/CLC-3781""

This reverts commit 1bfa780f6cb204b1513fe6efb37a591d4d26db65.