Fixed incorrect error messages in ProblemFactory class.