Moved output buffer clear from Exceptions to ExitException and updated tests

Signed-off-by: Darren Hill <dchill42@gmail.com>