A magnitude five quake is not God's punishment. It is God's stern but loving warning to stop whatever it is you're doing that is upsetting God. Instead of coming right out and telling you not to do something (he tried that in Genesis with disastrous results) God likes to keep you guessing.
So when a magnitude 5 hits, take inventory of your conduct, and gradually eliminate the things you are doing that displease God, such as believing what Pat Robertson says, painting a Hitler mustache on an Obama photo, or being Newt Gingrich.
There are various natural disaster punishments for various conducts, and although innocent people are also greatly harmed during these events, God feels it's worth it if he can punish those who offend him by doing bad things like dishonoring their father and mother, or contemplate having other Gods before him.
So you see--God isn't stupid. He really knows what he's doing. Can't you tell?