Bug fixes thanks for the SharedObject unit test.