Apply code review changes to the spell checking & partial matching logic