Fixing bug with tool unregistering.