Fix documentation and a little bug