Removing an input removes the output

The same bug where it decrements twice under certain conditions