Handle def with docstring

Current implementation doesn't handle def's with docstrings correctly.