Fixed possible infinite loop null refs in cache client; fixes #20