Update to handle missing values

First try revealed that I had not told R how to handle missing values.
It should work now.
Final changes

The map file generation part was problematic. This is finally a working
iteration.