Fixed faulty prime detection.
Fixed faulty prime detection algorithm.