Remove unnecessary spaces at the end.