Bugfixes and doccing