Minor tweaks to edge detection.