Fix prime function issue.