Fix programmatic generation of main function docstrings

Closes #99