A useful feature is Source > Correct Indentation. Select the code where the indents are incorrect and invoke the action.