Fix a bug involving nested links (closes #61 and #62).