Bug fixes and re-factoring for LineReader and CirculaBuffer