Fixed package name matching algorithm.