Porting 2.x fix over to 3.x
Merge pull request #2 from cthos/partial_match_3.x

Porting 2.x fix over to 3.x