Fix/double bindings

Builds on #113 and #114.

Main addition is that we now test for double bindings. The PR contains the necessary fixes so that the tests pass.