JCR-2051: applied the same changes as jcr 1.15