Fixing Bug #133 on conversion from 2D rays to 3D rays