I don't think there is any flaw in the original question. I guess the base assumption in the original question is that, no one wanted to slap himself (i.e., no one wanted to assume that he was wearing a black hat) UNTIL he was convinced so.
In the case of 3 people wearing the black hat, each one among the 3 would only see the other two wearing black hat. For the first 2 times of light-off, they assumed only these two guys being black, AND expecting these two guys to slap face. Since each of the 3 guys thought so, no one slapped himself. Only then (after the light was off twice), each of the 3 black-hatted guys realized that he himself was black along with the other two. Therefore, all these three slapped themselves when the light was off for the third time.
For all the rest people (being white-hatted), they always saw three black hats, and expecting these 3 guys to slap face. So no one among the white-hatted people would slap himself.
(Here, all the participants of the party should have high IQ to follow the logic. Otherwise, the result could be a mess. For instance, if the three black-hatted guys were not smart enough to slap themselves in the third time of light-off, then many many white-hatted people would think themselve to be the 4th guy wearing the black hat, slapping themselves for the 4th time of light-off).