Fixed API bug caused by circular neighborhood references.

Closes #457.