Added a minimum threshold for string length differences in order to prevent catastrophic cancellation.