Fixed error with self link nested

Fixes #284