Fix #16; add some tests for macros