Not sure that anything can be done about the first one. "class Stuff" is less of a match than " #End of line comments on " because it's a longer string. I bet it's a border line case though. Even changing certain percentages, I don't think that anything can be done about this one.
When there is a mismatch, the line is studied to see if the line is possibly a modified line (not an inserted line). This logic is never always right and can't be. Hope this makes sense.