More docs, error handling, bugfixes.