Improvements and fixes for the `lgtdoc` tool