Added better support for exception formatting