Fixed double end character at end of file.

Fixed bug #1