Leg bones messed up

http://www.pasteall.org/blend/31684

Theres my blend file. For some reason, my leg rig goes all crazy. Any help? I’m not sure of the arm either.

looks like aslight bend in the bones make it work better