Allow mutually defined instances

Fixes #657
Fix error reporting with mutual instances