add several useful macros.
fix intern bug.