Use a single flag to control error messages instead of two