Clean up throw/catch code a bit.