docgen: various fixes