[2.0] Fix for #2907, labels on varlength patterns where not checked properly.