fixed RingBuffer; weighted_avg still not really tested