Bugfixes and doc