Fix error in Miller-Rabin algorithm (should return true if x==-1)