Improved docs. Bug fixes