bugfixes and documentation fixes