Fix char deactivation on error