Add unittest and MacroError; Fix typo