Fixes circular dependency protection

Supersedes and closes #102.