support for references (dbref), improved logging