Client shutdown improvement. 

Near cache cleanup fix.