Updated quaternion related functions.