better error messages, bugfixes, docs