add debug mode to generate-documentation and fix small bug