Uncaught exception bugfix