Fix bug with multiple equal callbacks not being removed with 'off' call

This fixes a problem with adding multiple identical callbacks and then removing them with an "off" call, expecting all to be removed.