created some tests for _traverse_dict. Fixed some bugs found while testing.