CLEARWATER: XOP-261 fixes

XOP-261 had a complex history of patches on the master and tallahassee branches. This pull request cherry-picks all commits that are needed to resolve the issue on clearwater.