bugfixes and documentation enhancement