LIB: Fix bug where settings with partial name overlap would cause problems

This was causing a problem with the settings "K" and
 "KNN_NORMALIZATION" because of the overlap of one setting with the name
of another.

Ticket #689