Some documentation and bugfixes