Rewrite custom macros to fix bug with optional __STEP__

Signed-off-by: Nano <a>