Fixing bug with certificate cache cleanup