Added documentation, minor bugfix.