Proper cleanup of the shared directory.