Fix returning wrong type when match after unknown extension

fixes #7