Fixed queues and tests.
Merge pull request #139 from xi-project/fix-queues

Fixed queues and tests.