Fix name errors on error conditions