After you flipped the stem, did you tighten the stem bolts before you tightened the head bolt? If so, do it the other way around. Tighten the head bolt until the fork/steerer tube is no longer loose, making sure that your steering is not impeded. After that, align the stem and tighten the stem bolts. If this doesn't make sense, check the Sheldon Brown and/or Park Tool websites. I forget the exact site names, but you can google them.