Got inline links working.
Got ref links working, but with deallocation issues.