Read by character to avoid introducing extra newline.
Bug fixes.