matches: Linting + handle edge cases