more docs and some error type fixes