Fixed some bugs about RingQueue() and SmallRingQueue().

Signed-off-by: shines77 <gz_shines@msn.com>