core: fix ubf encoding of objects. Does this fix #804?