Make attributes consistent and fix attr names in __repr__.
Always add a trailing newline when returning new source.