Catch more exeptions (Bug #12343).