Raycaster related fixes