Fix strange indentation and remove trailing whitespace on empty lines