The day-ahead problem of finding optimal dispatch and prices for the Brazilian power system is modeled as a mixed-integer problem, with nonconvexities related to fixed costs and minimal generation requirements for some thermal power plants. The computational tool DESSEM is currently run by the independent system operator, to define the dispatch for the next day in the whole country. DESSEM also computes marginal costs of operation that CCEE, the trading chamber, uses to determine the hourly prices for energy commercialization. The respective models sometimes produce an infeasible output. This work analyzes theoretically those infeasibilities, and proposes a prioritization to progressively resolve the constraint violation, in a manner that is sound from the practical point of view. Pros and cons of different mathematical formulations are analyzed. Special attention is put on robustness of the model, when the optimality requirements for the unit-commitment problem vary.