Changed structure element for dilation of masks (haven't found reason for segfault)