Nicer error on bad number
Better sorting
Inline, since we only use in one place
Use ECDSA package now