Improve documentation and resolve all warnings