Fixed API bug caused by circular neighborhood references.

Closes #457.
Merge branch 'staging'