fix related doc ref count errors