Fix for #2907, labels on varlength patterns where not checked properly.
Merge pull request #3240 from pontusmelke/issue-2907

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