Fix the potential NP problem.