String diff: Fixed some edge cases with empty lines and lines containing only \r.