Fixed conversion of rotation matrices to quaternions (July 2012).