Revert "Revert "Merge pull request #2599 from christianv/CLC-3837""

This reverts commit 2ea18941f827452c2a58db2d8a3fd3a822240b46.