We analyse a market where quality is reflected in sunk costs and/or marginal costs. Firms provide too low quality as compared to the socially optimal solution whenever quality affects (at least) sunk costs. Entry would then increase welfare, but the number of firms is restricted by an upper limit that depends on how sunk costs and consumer utility are affected by a quality change. Firms may even produce an excessive output if both types of costs are dependent on quality. Moreover, entry reduces quality except for when the number of firms increases from two to three. Quality is on the other hand socially optimal and independent of market structure if only marginal costs are affected by quality, but output is too low unless the number of firms is very high.