Check if the mine count is at 0 and not at -1 or worse :)
I was going for a no flag and I counted the squares I didn't click and it totaled to 0. also, I am pretty sure there were 8 mines and I had 8 squares left