Docs setup, code cleanup, bugfix