Confirming that this fixes the issue, but shouldn't this be outside the try/except block, just above? That except clause is really there to catch errors that occur in the `run_cell` mode.

This is a very minor point, obviously. Just thinking of keeping the try part of except clauses as narrow as possible, especially b/c this one is a blanket, unqualified `except`, thus more likely to catch unintended things.