Fixed problem with metadata in NdMapping
Cleaned up NdMapping
Fixes and cleanup in ndmapping