Fixed errors in the refdocs that prevented certain documentation entries
from working
Handle function definitions better.
When a function definition fails, report the error and move the cursor
to the line where the error occurred.