Fix warnings.
Support for multi queue merge sorting.
Avoid deadlock.