Fix bug that removed error class improperly.