Write test for empty match and fix it