bugfixes and documentation