Bug fix in prime curve doubling: if 2 P = O then it erroneously returned