Fixed exception handling and stack trace printing. Exceptions now work properly in multi-threaded situations as well.