Generate then-part
Add initial indentation
Set newline flag after newline
Fixed indentation problems