Backport JCLOUDS-467 to 1.7.x