Fix deque iteration