Rotation Problems

I believe something is wrong with my Quat Powering function. One both
sides of one diagonal of the square walk pattern the rotate doesn't work
correctly. On the other it works as expected.