Fixes enqueue and dequeue