fix handling of cmap, add cmap test, fix broken tagged value test