Documentation and examples fixes, bugfixes