fix error_func in safe exception and tuple iteration.