docs and bug fixes