Add FormatAtomLine() and some bug fixes.