Added better shared object handling.