If an output is removed, its handle is invalid, which can lead to a crash.
mentioned in commit 2395fa82