Cleanup for lib client