fixed malloc bug with disinguished maps versus primary map