Fixed ray bug