Fix check of return value for DBObject::__functions