Fixed a bug in toggleOutput.