Fix autoindent bug in docstrings and add a test