Fix sort key of longest string function.