some fixes to the queue methods and tests