bugfixes and docs