documentation and minor fixes