Fixed seg fualt issues, head was not being wraped around in dequeue