Unittest for bug #973.
fix for bug #973.

An alternative solution for bug #970.

For chopped patterns, which in it's whole is a duplicate of another
pattern we assign an unique content id.