Bugfixing and improving documentation