Enclosed macros in do-while-loop

Resolves #5.