It doesn't really explain why, but I have found that if I use the Geoprocessing tool Dissolve instead of the editing tool Merge, the lines merge without corrupting. I would still be interested to know what the difference is between these two methods, but this does solve the problem.