improved matching by string similarity and some minor bug fixes2