Fixing Side effects of the last major merge

fixed bugs in Queue System
Support for both sorted and regular dictionaries
fixed tests