fixes in document generation