Some documentation and fixes