Fixed bugs in edge detectors