Fix for TRUNK-3836
TRUNK-3836: Improvements on first fix