Fixed bug for files that do not end with a newline character