BUG Fix regressions from #2206 in hasValue and dbObject

Fixes #2982