Merge pull request #414 from parrt/master

Add tests for ungrammatical tree patterns. Fixes #413