Fix for CB-5534

As discussed here: https://issues.apache.org/jira/browse/CB-5534