I believe you need to use get_coll_ct here (and in all the ones below as well). Unless something prevents us setting attrs on or cloning to/from temp collection objects that I'm not aware of...