template: macros; bug with lookup on empty smap