Fix bugs

Forgot a few things earlier.
Use collections.deque for pipes