Fix NewPrivateKey ECDSA parsing, and add test