Handle more errors; improve docs.