[[ Bug 13987 ]] Make sure data refs are destroyed properly