BUG Fix regressions from #2206 in hasValue and dbObject