Fix overly broad exception catching.