correctly add multiple ‘}’ for multiple dedents
fix preserving trailing blank lines in general