The first row and first column are now getting skipped. Most of them get touched by the NE and SW checks, but that's not sufficient (for example if there is a left-right or up-down discontinuity in the first row it won't be counted). 

Actually this bug was also somewhat present before (e.g. left-right discontinuities were not checked in the last row). This seems to get handled later by BORDER_POLICY_IGNORE, although it looks like BORDER_POLICY_MIRROR isn't doing the right thing. Maybe just zero out the borders and columns? This effectively makes BORDER_POLICY_MIRROR a no-op, but honestly I'm not sure how useful that mode is (seems like it would produce really bad normals).