NH-3667
NH-3102
Fix
Corrections
Split long line as requested
Added comment
Minor optimization and code cleaning
Fix with unit tests