Cleaning trailing whitespace where possible