Fixed off-by-one bug when initializing ProducerConsumerQueue in generic code