Fixed error handler (remove dead-end case)