Fix dilate PENCIL code.