Fixed quaternion bugs and added a spec.