Refactoring tests, fixing path matching bug.