Don't forget to call the unregister functions of outputs.