Exception handling, output formatting