bugfix as_dict Issue #4