Backport JCLOUDS-489 to 1.7.x