Fixes #4. Matching code redone.