Bug fixed in getMatchLength