Updated prime detection.