fixing tests, cleanups, docs