Better error handling.

Private key handling.

Exporting.
