fix Issue 10016 - Incorrect error gagging using RefCounted