Backport JCLOUDS-423 to 1.7.x