matrix rotation fixes