Lines are doubled only the first time and then everything is fine, but if extra lines are added, these (and not the previous ones) are doubled too.
So there is a difference between lines you type and lines that are already there, making me suspect something involving CR+LF.