Tests for NH3641
Fix for NH3641
Make the testcase a bit more interested and avoid fix warnings.
Fix indenting.
Merge fix for NH-3641 (pull request #283).