Fix incorrect ref namespace check