(Algorithms1, week2) Bug fixes in Deque

Fixes issue with iterator
Fixes issue of loitering in some cases