fixes to trunk 3991
Merge pull request #316 from surangak/TRUNK-3991

fixes to trunk 3991