Fix bug in quaternion implementation.