Avoid catching Error instances in various places. See #443.