Fix dequeueing with args

Dequeue with args always removed first elements on queue when args matched.