#5 added more safety checks in RingBufferDefault imll