Fixed prime number check.