set default to avoid uninitialized stuff
make ca_error return the errno
fix some brainfarts