Added unit test for #617
Also trim off NL following BR
fixes #617
Merge branch 'od/issue_617' into develop