fixed flatten and horizon filler patterns, fix #1598