Fixes issue #2

The qhead pointer was off, since it wasn't updated when it should.  Now
it's properly updated for every iteration.