Fix to dilation and erosion operator