Fixed error with Sqr function of castRay