Remove empty space from end of file