cir_queue: fixed critical bugs