Bugfixes and doc updates