Report bad-pattern errors more specifically.

Closes #107.