Improve documentation and fix a type