Fix error_reporting directive check (#1489323)