fix parsing of Mapping and minor cleanups