Fix strings preprocessing for justification heuristic