There should be a single newline at eof. Why are you removing these!