bugfixes, docs, tests