Fixed error, which described in previous commit - switched from default dictionary to OrderedDict.
Also, fixed small mistype in test code.