HR-340 fix and additional fixes
Merge pull request #550 from monishdeb/HR-340

HR-340 fix and additional fixes