Fixed tests.  Added tests for handling shared memory exception.  Fixed code to handle shared memory exception.