Properly handle uid for orphan search