It only removes items after the output is removed

Shift clicking still gives one less than it should, also if you take out
an input the output remains (easy fix)