Fix if-else autoformatting
Cleanup
Moving flag reset
Merge pull request #2477 from AmnonOwed/Fix#364-AutoFormatIfElse

Fix #364 if-else autoformatting