Fix pointers and avoid false positives by also checking the square root.  9, for example was being called prime.