HMC5883L compass huge error [SOLVED]

You are taking me out of my area of expertise here, and I don't have the chip to hand. All I can suggest is Googling for someone who might have sample code. If their exact code works, and yours doesn't maybe a bad chip?

I must admit I couldn't find much except a blog written in Swedish.