Fixed three bugs with the x-ray