various fixes and better docs