documentation and fixes