fixes #125 detaching nodes triggers

didn't have time to add the test suite showing the bug, but it's still passing.