Fix doc_generation dumping to be more robust

Signed-off-by: Josep M. Blanquer <blanquer@rightscale.com>