Bugfix in Exception handling