Fix new line at EOF and remove white spaces at the end of lines