Fixing bugs in original Deque implementation