Better documentation and minor bugfix