bug fixes and new doc