remove trailing tabs and empty lines and fix indents