I write this tu suggest a less cosmetic improvement, but may be of more practical (at least debugging...) value.
If NS encounters an error or atipical condition an has to close itself, may be a dump of the exception with all it's exception tree to a file in a human readable format would be a great help to fix the bug.
I can help if you think there is help needed, I'm a C & C++ programmer, and know quite good the bussiness.
Thanks