Bug fix for directions perpendicular to Z in DistFromInside
(cherry picked from commit b44702d626e831e1493da969b92b0b7b5c972cf1)