Bugfixes, extra documentation added