Fixes #5. Don't edit patterns attribute directly.
Pass patterns attribute as parameter to PatternMatchingEventHandler
constructor instead.