Change to double precision in quaternion related calculations