Fixes issue NH3609

Hey guys,

Found this issue last week, managed to fix it with a fairly straightforward change. It affects back to at least 3.3.2.4000 . Let me know if I need to enhance the test case, but I think it illustrates the issue fairly clearly.