Fix common start / end detection in Diff.class.php