Full documentation and some fixes