Fix for watershed and edge pixels