Correcting some bugs + correcting rotations.

I'm not completly sure about rotations, but it seems that signs were wrong...