Fixed doc generation code