Make sure ring buffer size is a power of 2

close issue #3