Several minor bug fixes on the doc