HR-327 and additional fixes
Merge pull request #539 from monishdeb/HR-336

HR-327 and additional fixes