- Fixed reame formatting.
- Use os.linesep for newline instead of \n
- Fixed error in line replacement.