Added documentation, bugfixes.