Do inverse matching correctly.

Fixes #3.