Masking invalid distances...

I believe my mapping routine was still functioning properly before
masking out invalid (e.g., inf) distances, but I'm adding this in
anyway as there is no real hit in processing time.