Added unit tests for newline encoder and fixed a bug (#70)