Backport JCLOUDS-470 to 1.7.x