Fixed queueHead bug for FIFO